const router = require('koa-router')()
const { url } = require("../utils/url")
const response = require("../utils/response");
router.post('/upload', async (ctx, next) => {
    const file = ctx.request.files.wxfile;
    response.success(ctx, { message: '上传成功', data:Array.isArray(file)?file.map(e=>{
            return {
                name: e.originalFilename,
                url: url + e.newFilename
            }
        }):[{
            name: file.originalFilename,
            url: url + file.newFilename
        }] });
})
module.exports = router
